package org.skyer.third.gateway.api.enums.ali;

import java.util.Arrays;
import java.util.List;

/**
 * 1688订单退款状态
 */
public enum AliBaBaOrderRefundStatusEnum {


    WAIT_SELLER_AGREE("waitselleragree", "等待卖家同意"),
    REFUND_SUCCESS("refundsuccess", "退款成功"),
    REFUND_CLOSED("refundclose", "退款关闭 "),
    WAIT_BUYER_MODIFY("waitbuyermodify", "待买家修改"),
    WAIT_BUYER_SEND("waitbuyersend", "等待买家退货"),
    WAIT_SELLER_RECEIVE("waitsellerreceive", "等待卖家确认收货");


    private String code;
    private String desc;

    AliBaBaOrderRefundStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    AliBaBaOrderRefundStatusEnum() {
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static boolean checkIsRefunding(String code) {
        List<String> list = Arrays.asList(WAIT_SELLER_AGREE.getCode(), WAIT_BUYER_SEND.getCode(), WAIT_BUYER_MODIFY.getCode()
                , REFUND_CLOSED.getCode());
        if (list.contains(code)) {
            return true;
        }
        return false;
    }



}
